﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using FXSStation.Modules.SharedInfrastructureModule.BusinessClasses.Chart;

namespace FXSStation.Modules.SharedInfrastructureModule.BusinessClasses.Chart_Indicators
{
    public abstract class IndicatorBase
    {
        /// <summary>
        /// Period in Days to calculate
        /// </summary>
        public int Period { get; set; }

        /// <summary>
        /// Recalculated data by the indicator
        /// </summary>
        public ObservableCollection<double?> IndicatorData { get; set; }

        /// <summary>
        /// Data from the Chart
        /// </summary>
        internal ObservableCollection<StockItem> _chartData;

        /// <summary>
        /// Recalculates the Indicator data
        /// </summary>
        public abstract void Calculate();

        /// <summary>
        /// Recalculates the Indicator data dynamically
        /// <remarks>
        /// Recalculates when the Chart Data Changes
        /// </remarks>
        /// </summary>
        public abstract void CalculateDynamic();

        public IndicatorBase(int period, ObservableCollection<StockItem> data)
        {
            this.Period = period;
            this.IndicatorData = new ObservableCollection<double?>();
            _chartData = data;
        }
    }
    
}
